projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a7706f
)
rbtree: Fix removing last element
author
Benjamin Otte
<otte@redhat.com>
Mon, 14 Jan 2019 17:42:18 +0000
(18:42 +0100)
committer
Benjamin Otte
<otte@redhat.com>
Mon, 14 Jan 2019 17:42:18 +0000
(18:42 +0100)
The refactoring of automatically updating tree->root when setting a
node's parent works very well - unless all nodes get removed and no
node's parent got updated.
gtk/gtkrbtree.c
patch
|
blob
|
history
diff --git
a/gtk/gtkrbtree.c
b/gtk/gtkrbtree.c
index 4e521892330619290fa7127cc5e7dec9352484dc..85055b1cb4bb254592734a2886f0eb0ab3485054 100644
(file)
--- a/
gtk/gtkrbtree.c
+++ b/
gtk/gtkrbtree.c
@@
-708,6
+708,11
@@
gtk_rb_tree_remove (GtkRbTree *tree,
p->right = x;
gtk_rb_node_mark_dirty (p, TRUE);
}
+ else
+ {
+ if (x == NULL)
+ tree->root = NULL;
+ }
/* We need to clean up the validity of the tree.
*/